-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Move asset hashing into a linker intercept step #3988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Because asset optimization is now a full linker step, it no longer works with the command added in #3429. If you want to use the dx asset optimizer outside of the CLI, you need to use the CLI as a linker like this (copied from the new help section): Dioxus Asset OptimizerWhen you serve dioxus with dx, it will automatically handle the build process for you. If you need to integrate with a larger build system, Usage with trunkIf you are using trunk, you need to create a temporary asset directory to store the output of the dx asset optimizer that will be copied by trunk into your dist directory: <html>
<head>
<link data-trunk rel="rust"/>
<link data-trunk rel="copy-dir" href="./dist_assets/" data-target-path="./assets/"/>
</head>
<body>
<div id="main"></div>
</body>
</html> Then when you build, you need to set the DX_LINK_ASSETS_TARGET="dist_assets" RUSTFLAGS="-Clinker=dx" trunk serve Usage with cargoIf you are using cargo, you need to set the DX_LINK_ASSETS_TARGET="dist_assets" RUSTFLAGS="-Clinker=dx" cargo run Custom linker pathDX will try to find the default linker for your system, but if you need to use a custom linker on top of the dx proxy, you can set the DX_LINKER="/path/to/lld" DX_LINK_ASSETS_TARGET="dist_assets" RUSTFLAGS="-Clinker=dx" cargo run |
TODO:
Fixes #3705
Fixes #3467
Fixes #3918
Stacked on #4042